<template>
	<view>
		<!-- <uni-nav-bar left-icon="back" @clickLeft="goBack" @clickRight="backRight" right-text="分析报告" title="告警信息"></uni-nav-bar> -->
		<view class="">
			<v-tabs v-model="activeTab" :scroll="false" :tabs="tabs" @change="changeTab"></v-tabs>
		</view>
		<!-- 内容  1.困人信息-->
		<view class="" v-show="activeTab == 0">
			<uni-card v-for="(item,index) in recordList" :key="index">
				<view class="record">
					<view class="record-address">
						{{item.address}}
						<text>{{item.intervalTime}}</text>
					</view>
					<view class="record-state">
						{{item.state}}
					</view>
					<view class="information">
						<!-- left -->
						<view class="information-left">
							<view class="record-time">
								困人时间:
								<text>{{item.time}}</text>
							</view>
							<view class="record-time">
								恢复时间:
								<text>{{item.recoverTime}}</text>
							</view>
						</view>
					</view>

				</view>
			</uni-card>
		</view>
	<!-- 内容  故障信息-->
	<view class="" v-show="activeTab == 1">
		<uni-card v-for="(item,index) in recordList" :key="index">
			<view class="record">
				<view class="record-address">
					{{item.address}}
					<text>{{item.removal}}</text>
				</view>
				<view class="record-state">
					{{item.state}}
				</view>
				<view class="information">
					<!-- left -->
					<view class="information-left">
						<view class="record-time">
							上报时间:
							<text>{{item.time}}</text>
						</view>
						<view class="record-time">
							恢复时间:
							<text>{{item.recoverTime}}</text>
						</view>
					</view>
					
				</view>
	
			</view>
		</uni-card>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				activeTab: 0,
				tabs: ['困人信息', '故障信息', '事件信息'],

				// 内容
				recordList:[
					{
						id:0,
						address:"枫林绿洲-1号楼-1单元-南梯",
						state:"[反复开关门]",
						removal :"自清除",
						time:"2020-01-15 15:33:23",
						recoverTime:"2020-01-15 15:33:23",
					},
					{
						id:1,
						address:"枫林绿洲-1号楼-1单元-南梯",
						state:"[反复开关门]",
						removal :"自清除",
						time:"2020-01-15 15:33:23",
						recoverTime:"2020-01-15 15:33:23",
					},
					{
						id:2,
						address:"枫林绿洲-1号楼-1单元-南梯",
						state:"[反复开关门]",
						removal :"自清除",
						time:"2020-01-15 15:33:23",
						recoverTime:"2020-01-15 15:33:23",
					}
				]
			}
		},
		methods: {
			// 导航返回事件
			goBack(){
				uni.switchTab({
					url:"../../tabbar/work/work"
				})
			},
			// 导航右边事件
			backRight(){
				uni.switchTab({
					url:""
				})
			},
			changeTab(index) {
				console.log('当前选中的项：' + index)
			},
		}
	}
</script>

<style scoped>
	.uni-icons {
		color: #3AC211;
	}

	.uni-card {
		width: 670rpx;
		/* height: 280rpx; */
		background: #FFFFFF;
		box-shadow: 0rpx 10rpx 10rpx 0rpx rgba(52, 54, 61, 0.05);
		border-radius: 16rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		border: none;
		line-height: 280rpx;
		text-align: left;
	}

	.record {
		font-family: PingFang SC;
		font-weight: 400;
		/* margin: 40rpx 0; */
	}

	.record-address {
		font-size: 30rpx;
		color: #34363D;
		display: flex;
		justify-content: space-between;
		font-weight: 400;
		margin-bottom: 30rpx;
	}

	.record-address text {
		color: #FF5753;
		font-weight: 400;
	}

	.record-state {
		font-size: 30rpx;
		color: #017EFE;
	}

	/* 左右 信息*/
	.information {
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-wrap: nowrap;
	}

	.record-time {
		font-size: 24rpx;
		color: #989BA6;
	}

	.record-time text {
		margin-left: 15rpx;
		color: #34363D;
		word-spacing: 15rpx;
		letter-spacing: 1rpx;
	}
	
	.successState{
		background: #65D0D5;
		width: 150rpx;
		height: 60rpx;
		text-align: center;
		box-shadow: 0px 5px 10px 0px rgba(58, 194, 17, 0.2);
		border-radius: 28rpx;
		color: #FFFFFF;
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
	}
	.successState image{
		
		width: 30rpx;
		height: 30rpx;
		background: #65D0D5;
		border-radius: 10rpx;
	
	}
</style>
